package com.car.spdier;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import com.car.spdier.service.ParseService;
import com.car.spdier.service.dao.entity.UrlEntity;

public class HashTable extends java.util.Hashtable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static java.util.Map<String, UrlEntity> hashTable = new java.util.Hashtable();

	public static String shanghaiCode = "021";
	static {
		hashTable.put(shanghaiCode, new UrlEntity(
				"http://www.shjtaq.com/zwfg/dzjc_new.asp", "gb2312", 10));
	}

	private void HashTable() {
	}

	public synchronized static Map getHashTable() {
		return hashTable;
	}

	public static String getUrl(Object city) {
		// TODO Auto-generated method stub
		UrlEntity entity= hashTable.get(city);
		if(entity==null){
			return "";
		}
		return entity.getUrl();
	}

	public static String getCharset(Object city) {
		// TODO Auto-generated method stub
		UrlEntity entity= hashTable.get(city);
		if(entity==null){
			return "";
		}
		return entity.getCharset();
	}

	public static UrlEntity getEntity(String city){
		return hashTable.get(city);
	}
	public boolean removeObj(String key) {
		// TODO Auto-generated method stub
		  hashTable.remove(key);
		  return true;
	}

	public int size() {
		// TODO Auto-generated method stub
		return 0;
	}

 

	public  boolean isEmpty() {
		// TODO Auto-generated method stub
		return hashTable.isEmpty();
	}

}
